﻿using System;

namespace ZL.WeChatCard.Entity.EasyUse
{
    public class WalletInfo
    {
        private string _accname = string.Empty;
        private string _accsrcbrname = string.Empty;
        private string _accskbrname = string.Empty;
        private string _accskppname = string.Empty;
        private DateTime? _acchbbegdate = DateTime.Now;
        private DateTime? _acchbenddate = DateTime.Now;

        /// <summary>
        ///  账户显示名称
        /// </summary>
        public string Accname
        {
            get { return _accname; }
            set { _accname = value; }
        }

        /// <summary>
        ///  钱包id（也作为消费顺序（退消费→红包→钱包id））
        /// </summary>
        public decimal Accwid { get; set; }

        /// <summary>
        ///  钱包类型：1-红包（不显示在余额中，仅进行详细查询时显示）
        /// </summary>
        public short Accwtype { get; set; }

        /// <summary>
        ///  来源门店id（钱包生效地点，如取门店，余额调整：调整地点）
        /// </summary>
        public int Accsrcbrid { get; set; }

        /// <summary>
        ///  来源门店名称
        /// </summary>
        public string Accsrcbrname
        {
            get { return _accsrcbrname; }
            set { _accsrcbrname = value; }
        }

        /// <summary>
        ///  收款营业日
        /// </summary>
        public DateTime? Accskyydate { get; set; }

        /// <summary>
        ///  收款门店id（收款核算对象id）(余额调整：虚拟机构)
        /// </summary>
        public int Accskbrid { get; set; }

        /// <summary>
        ///  收款门店名称
        /// </summary>
        public string Accskbrname
        {
            get { return _accskbrname; }
            set { _accskbrname = value; }
        }

        /// <summary>
        ///  收款品牌id
        /// </summary>
        public int Accskppid { get; set; }

        /// <summary>
        ///  收款品牌名称
        /// </summary>
        public string Accskppname
        {
            get { return _accskppname; }
            set { _accskppname = value; }
        }

        /// <summary>
        ///  红包增值钱包开始使用日期
        /// </summary>
        public DateTime? Acchbbegdate
        {
            get { return _acchbbegdate; }
            set { _acchbbegdate = value; }
        }

        /// <summary>
        ///  红包增值钱包截止使用+B6+E97
        /// </summary>
        public DateTime? Acchbenddate
        {
            get { return _acchbenddate; }
            set { _acchbenddate = value; }
        }

        /// <summary>
        ///  充值入：现金金额
        /// </summary>
        public decimal Accincashmy { get; set; }

        /// <summary>
        ///  充值入：增值金额
        /// </summary>
        public decimal Accinaddmy { get; set; }

        /// <summary>
        ///  累积出：现金金额
        /// </summary>
        public decimal Accoutcashmy { get; set; }

        /// <summary>
        ///  累积出：增值金额
        /// </summary>
        public decimal Accoutaddmy { get; set; }

        /// <summary>
        ///  计余额：现金金额（充值入-累计出）
        /// </summary>
        public decimal Acccashbalance { get; set; }

        /// <summary>
        ///  计余额：增值金额（充值入-累计出）
        /// </summary>
        public decimal Accaddbalance { get; set; }

        public string type
        {
            get
            {
                if (Accincashmy != 0)
                {
                    return "充值";
                }
                if (Accincashmy != 0)
                {
                    return "消费";
                }
                return "";
            }
        }

        public string BDate
        {
            get
            {
                if (Acchbenddate != null)
                {
                    return Acchbenddate.Value.ToString("yyyy-MM-dd");
                }
                return null;
            }
        }

        public decimal Amount
        {
            get
            {
                if (Accoutcashmy != 0)
                {
                    return Accoutcashmy;
                }
                if (Accoutcashmy != 0)
                {
                    return Accoutcashmy;
                }

                return 0;
            }
        }

    }
}
